Lint the Dockerfile at Build Time

Follow these best practices when writing the Dockerfile:

  • Ensure a USER directive is specified.

  • Add a security linter as a step in the build pipeline.

  • Ensure the base image version is pinned.

  • Ensure the OS packages versions are pinned.

  • Avoid the use of "ADD" in favor of COPY.

  • Avoid curl bashing in RUN directives.